package com.rem.chat.service.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author: Themberfue
 * @date: 2025/6/5 21:35
 * @description:
 */
@AllArgsConstructor
@Getter
public enum UserContactStatusEnum {
    NOT_FRIEND(0, "未关联"),
    FRIEND(1, "已关联"),
    DEL(2, "已删除"),
    DEL_BE(3, "被删除"),
    BLACKLIST(4, "已拉黑"),
    BLACKLIST_BE(5, "被拉黑"),
    BLACKLIST_BE_FIRST(6, "申请时被拉黑");

    private final Integer status;
    private final String desc;

    public static UserContactStatusEnum getByStatus(Integer status) {
        try {
            for (UserContactStatusEnum item: UserContactStatusEnum.values()) {
                if (status.equals(item.getStatus())) {
                    return item;
                }
            }
            return null;
        } catch (Exception e) {
            return null;
        }
    }
}
